import { shell } from 'electron';
import { getType } from './getType';
import { errorDialog } from '@e/dialog';

export function show(path: string) {
	switch (getType(path)) {
		case 'dir':
			shell.openPath(path);
			break;
		case 'file':
			shell.showItemInFolder(path);
			break;
		case 'error':
			errorDialog('错误', `"${path}" 路径不存在`);
			break;
	}
}
